import { defineStore } from 'pinia'
import axios from 'axios'

export const useDrinksStore = defineStore('drinks', {
  state: () => ({
    featuredDrinks: [],
    awards: [],
    baristas: [],
  }),
  actions: {
    async fetchFeaturedDrinks() {
      const res = await axios.get('/api/featured_drink')
      this.featuredDrinks = res.data
    },
    async fetchAwards() {
      const res = await axios.get('/api/awarded_drink')
      this.awards = res.data
    },
    async fetchBaristas() {
      const res = await axios.get('/api/barista_info')
      this.baristas = res.data
    },
  },
})
